module AccountFlowsHelper
  PROTOTYPE = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'

  def flow_id
    time = DateTime.parse(Time.now.to_s).strftime('%Y%m%d%H%M%S').to_s
    "#{time}#{rand_flow_id(10)}"
  end

  def rand_flow_id(length)
    str = ''
    length.times do
     rand_count = rand(PROTOTYPE.length)
     str += PROTOTYPE[rand_count]
    end
   return str
  end

end
